package com.socialuni.sdk.api;

import com.socialuni.sdk.api.model.ResultRO;
import com.socialuni.sdk.api.model.QO.comment.SocialCommentDeleteQO;
import com.socialuni.sdk.api.model.QO.comment.UniCommentPostQO;
import com.socialuni.sdk.api.model.RO.comment.TalkCommentRO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

@RestController
@RequestMapping("socialuni/comment")
@FeignClient(name = "comment", url = "${social.server-url:https://api.socialuni.com}")
public interface CommentAPI extends FeignAPI {
    @PostMapping("addComment")
    ResultRO<TalkCommentRO> addComment(@RequestBody @Valid @NotNull UniCommentPostQO commentVO);

    @PostMapping("deleteComment")
    ResultRO<Object> deleteComment(@RequestBody @Valid @NotNull SocialCommentDeleteQO commentVO);
}